import 'dart:io';

import 'package:redis/redis.dart';

final conn = RedisConnection();

void main() {

  final conn = RedisConnection();
  conn.connect('localhost', 6379).then((Command command) {
    command.send_object(["SET", "key", "0"]).then((var response) {
      assert(response == 'OK');
    });
    command.send_object(["INCR", "key"]).then((var response) {
      assert(response == 1);
    });
    command.send_object(["INCR", "key"]).then((var response) {
      assert(response == 2);
    });
    command.send_object(["INCR", "key"]).then((var response) {
      assert(response == 3);
    });
    command.send_object(["GET", "key"]).then((var response) {
      print(response); // 3
    });
  });



}